<?php

namespace component\element\elementchoose\controller;

use app\bll\ComponentElement as BllComponentElement;
use core\traits\ElementView as TraitsElementView;
use app\bll\Datadict as BllDatadict;
use core\component\ElementBase;
use core\lib\schema\Schema;
use core\lib\schema\Table;
use core\traits\Response as TraitsResponse;
use support\View;

class Index extends ElementBase
{


    public function index(...$param)
    {
        $bllDatadict         = new BllDatadict();
        $dicts               = $bllDatadict->select();
        $bllComponentElement = new BllComponentElement();
        $elements            = $bllComponentElement->cascader('id,name,title,pid,polymorphic,source');


        return $this->view(array_merge($param, [
            'dicts'    => $dicts,
            'elements' => $elements,
        ]));
    }
}
